<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.osee.administration.service.*"%>
<%@ page import="org.osee.administration.domain.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf8" http-equiv="Content-Type" />
<title>OSee观点搜索引擎 - 管理首页</title>
<link rel="stylesheet" href="admin/styles/style.css" type="text/css" />
<link rel="stylesheet" href="admin/styles/record.css" type="text/css" />
<script type="text/javascript" src="admin/script/index.js"></script>
</head>
<body>

<%
	List<QueryRecord> qrList = null;
	List<IPEntity> ipList = null;
	Feedback feedback = null;

	try {
		ipList = (List<IPEntity>) request.getAttribute("ipList");
		feedback = (Feedback)request.getAttribute("feedback");
		System.out.println(request.getAttribute("rList").getClass());
		qrList = (List<QueryRecord>) request.getAttribute("rList");
	} catch(Exception e) {
		e.printStackTrace();
	} finally {
		if(qrList == null){
			qrList = new ArrayList<QueryRecord>();
		}
		if(ipList == null){
			ipList = new ArrayList<IPEntity>();
		}
		if(feedback == null){
			feedback = new Feedback();
		}
	}
%>
<div id="container">
<%@ include file="inc/header.inc"%>
<div class="clr"></div>
<%@ include file="inc/menu.inc"%>

<div id="admin_content">
<div id="banner">
<div class="banner-c1"></div>
<div class="banner-text">管理首页</div>
<div class="banner-c2"></div>
</div>

<!-- formList start -->
<div id="admin_ctt_list" style="width:760px;">
	<div class="ad-right-top" style="width:760px;">
		<div class="bar2-left"></div>
		<div class="bar2-center"></div>
		<div class="bar2-right"></div>
	</div>
	<div id="formContent">
		<div class="inner-block" style="width:746px; margin-bottom:5px;">
			<div class="bar-text">管理权限</div>
			<div class="inner-header" style="width:746px">
				<div class="bar-c1"></div>
				<div class="bar-c2"></div>
			</div>
			<div class="inner-content" style="width:744px;padding-bottom:5px;">
				<div style="width:343px; float:left; margin-left:5px; border:1px solid #CCCCCC">
					<ul style="padding-left:5px;">
					<%
						int i = 0;
						for(IPEntity ip: ipList){
							i++;
					%>
						<li id="<%=i+"ip" %>" title="<%=ip.getId() %>">
							<table>
								<tr><td width="20px"><%=i %></td><td width="100px"><%=ip.getIpAddress() %></td><td witdh="35px" class="flash" onClick="showEdit(<%=i %>)">编辑</td><td width="30px" class="flash" onClick="deleteIp(<%=ip.getId() %>)">删除</td></tr>
							</table>
						</li>
					<%} %>
					</ul>
				</div>
				<div style="width:343px; margin-right:5px; border:1px solid #cccccc; float:right; background-image:admin/img/bar2_bg1.gif">
					<ul style="margin:5px 5px 5px 5px; text-align:center">
						<form action="admin-addIPEntity.htm" method="post">
							<li>增加允许访问后台管理的IPv4地址</li>
							<li style="margin-top:5px"><input type="text" name="ipAddress" style="height:13px" /></li>
							<li style="margin-top:5px"><input type="submit" value="提交" style="font-size:11px" /></li>
						</form>
					</ul>
				</div>
				<div class="clr"></div>
			</div>
		</div>
		<div class="clr"></div>
		<div class="inner-block" style="width:350px; margin-bottom:5px; float:left">
			<div class="bar-text"><a href="admin-record.htm">用户日志</a></div>
			<div class="inner-header" style="width:350px">
				<div class="bar-c1"></div>
				<div class="bar-c2"></div>
			</div>
			<div class="inner-content" style="width:348px">
				<ul style="margin-left:14px; padding-bottom:10px; font-size:12px">
					<%
						i = 0;
						for(QueryRecord qr: qrList){
							i++;
					%>
					<li><table><tr><td width="20px"><%=i %></td><td><%=qr.getQueryStr() %></td></tr></table></li>
					<%} %>
				</ul>
			</div>
		</div>

		<div class="inner-block" style="width:350px; margin-bottom:5px; float:right">
			<div class="bar-text"><a href="admin-feedback.htm">用户反馈</a></div>
			<div class="inner-header" style="width:350px">
				<div class="bar-c1"></div>
				<div class="bar-c2"></div>
			</div>
			<div class="inner-content" style="width:348px">
				<ul style="margin-left:14px; padding-bottom:10px; font-size:12px">
					<%=feedback.getContent() %>
				</ul>
			</div>
		</div>
		<div class="clr"></div>
	</div>
</div>
<!-- formList end -->
<div class="clr"></div>
</div>

<%@ include file="inc/footer.inc"%></div>
</body>
</html>
